<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
	<title>发布详情</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	<link rel="stylesheet" type="text/css" href="../../css/swiper.min.css" />
	<style type="text/css">
		body {
			background-color: #FFFFFF;
		}

		.swiper-pagination {
			width: 2.05rem;
			height: 1.15rem;
			background: rgba(0, 0, 0, 0.23);
			border-radius: 0.57rem;
			font-size: 0.5rem;
			font-family: PingFangSC-Medium;
			font-weight: 500;
			color: rgba(255, 255, 255, 1);
			line-height: 1.15rem;
			position: absolute;
			bottom: 0.75rem;
			left: 15.95rem;
		}

		.swiper-pagination-bullet {
			width: 0.2rem;
			height: 0.2rem;
			margin-right: 0.3rem;
			background: #FFFFFF;
			opacity: 0.46;
		}

		.swiper-pagination-bullet-active {
			background: #FFFFFF;
			opacity: 1;
		}

		.flex-row-center {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
		}

		.flex-row-top {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: flex-start;
			padding-top: 1rem;
			padding-bottom: 0.75rem;
		}

		.aui-bar-tab .aui-bar-tab-label {
			display: inline-block;
			font-size: .7rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
		}

		.aui-bar-tab-item img {
			width: 1.1rem;
			display: inline-block;
			vertical-align: middle;
		}

		.img-inlineblock img {
			display: inline-block;
			vertical-align: sub;
		}

		.foot-img img {
			display: inline-block;
			width: 1.1rem;
		}

		.aui-bar-tab .aui-bar-tab-item {
			display: table-cell;
			position: relative;
			width: 1%;
			padding-top: .8rem;
			text-align: center;
			vertical-align: middle;
		}

		.line_active {
			border-bottom: 1px solid rgba(238, 238, 238, 0.5);
		}
		/*改写*/
		/*.left_img {
			width: 1.4rem;
			height: 1.4rem;
			margin-right: 0.5rem;
			border-radius: 50%;
			flex-shrink: 0;
		}

		.left_img img {
			width: 1.4rem;
			height: 1.4rem;
			border-radius: 50%;
			flex-shrink: 0;
		}*/

		.right_cont {
			/*padding-bottom: 0.75rem;*/
			margin-bottom: 0.5rem;
		}

		.expext_last_bottom {
			border-bottom: 1px solid rgba(238, 238, 238, 0.5);
		}

		.expext_last_margin_bottom {
			margin-bottom: 0.8rem;
		}

		.nickname_title {
			font-size: 0.65rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(119, 119, 119, 1);
			line-height: 0.9rem;
			margin-bottom: 0.25rem;
		}

		.content_main {
			font-size: 0.75rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(68, 68, 68, 1);
			line-height: 1.2rem;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			/*-webkit-line-clamp: 2;
			overflow: hidden;*/
			/*border: 1px solid black;*/
			margin-top: 0.3rem;
			/*float: left;*/
			width: 16rem;
			/*margin-bottom: 0.5rem;*/
		}

		.content_main img {
			display: inline-block;
			vertical-align: sub;
		}

		.replay_count {
			height: 1.7rem;
			background: rgba(246, 246, 246, 1);
			border-radius: 0.3rem;
			font-size: 0.65rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(114, 213, 239, 1);
			padding-left: 0.75rem;
			line-height: 1.7rem;
			/*margin-bottom: 0.55rem;*/
			margin-left: 1.8rem;
			margin-bottom: 0.55rem;
			/*display: block;*/
			/*width: auto;*/
		}

		.footer_wraper {
			display: flex;
			align-items: center;
			justify-content: space-between;
			/*margin-left: 1.8rem;*/
			padding-bottom: 0.6rem;
			margin-top: 0.5rem;
			/*border: 1px solid black;*/
		}

		.right_zan {
			display: flex;
			justify-content: space-around;
			/*border: 1px solid black;*/
		}

		.left_addtime {
			font-size: 0.55rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
			line-height: 0.8rem;
			display: flex;
			flex-direction: column;
		}

		.zan_style {
			font-size: 0.6rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
			display: inline-block;
			margin-left: 0.15rem;
			padding-right: 0.3rem;
		}

		.no_comment {
			padding-top: 1.75rem;
			text-align: center;
			font-size: 0.75rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(34, 34, 34, 1);
			line-height: 1.05rem;
			padding-bottom: 2.5rem;
		}

		.no_comment img {
			width: 5.5rem;
			height: 5rem;
			margin: 0 auto;
			margin-bottom: 0.5rem;
		}

		.video_play .play_btn {
			position: absolute;
			z-index: 99;
			left: calc(50% - 1.4rem);
			top: calc(50% - 1.4rem);
		}

		.pic-video {
			/*display: inline-block;*/
			/*height: 18.75rem;*/
			width: 100%;
			/*background-color: #fff;*/
			overflow: hidden;
			position: relative;
			/*transform: translateY(1rem);*/
		}

		.pv-btn {
			width: 5rem;
			height: 1.1rem;
			left: 50%;
			transform: translateX(-50%);
			position: absolute;
			bottom: .65rem;
			z-index: 99;
			display: flex;
			font-family: PingFangSC-Regular;
			font-size: .55rem;
			text-align: center;
			color: #333333;
			font-weight: 400;
		}

		.haha {
			background: url('../../image/bg/zhanwei.png');
			background-size: 100%;
		}

		.video_play .play_btn {
			position: absolute;
			z-index: 99;
			left: calc(50% - 1.4rem);
			top: calc(50% - 1.4rem);
		}

		.pv-btn>div:nth-child(1) {
			flex: 1;
			margin-right: .5rem;
		}

		.pv-btn>div:nth-child(1)>span {
			display: inline-block;
			width: 2.35rem;
			height: 1.1rem;
			line-height: 1.1rem;
			border-radius: .55rem;
			line-height: 1.1rem;
			background-color: #fff;
		}

		.pv-btn>div:nth-child(2)>span {
			display: inline-block;
			width: 2.35rem;
			height: 1.1rem;
			line-height: 1.1rem;
			border-radius: .55rem;
			background-color: #fff;
			line-height: 1.1rem;
		}

		.tab_video_img {
			display: flex;
		}

		.tab_video_img>div {
			width: 47px;
			height: 22px;
			text-align: center;
			background-color: #FFFFFF;
			border-radius: 11px;
			color: #333333;
			font-size: 11px;
		}

		.tab_video_img span {
			line-height: 22px;
		}

		.tab_video_img_active {
			background: -webkit-linear-gradient(#84E5FF, #6BB4FF, #7AAEE5);
			/* Safari 5.1 - 6.0 */
			background: -o-linear-gradient(#84E5FF, #6BB4FF, #7AAEE5);
			/* Opera 11.1 - 12.0 */
			background: -moz-linear-gradient(#84E5FF, #6BB4FF, #7AAEE5);
			/* Firefox 3.6 - 15 */
			background: linear-gradient(#84E5FF, #6BB4FF, #7AAEE5);
			/* 标准的语法（必须放在最后） */
			color: #FFFFFF !important;
		}

		.tab_video_img>div:nth-of-type(1) {
			position: absolute;
			left: 136px;
			bottom: 88px;
			z-index: 1000;
		}

		.tab_video_img>div:nth-of-type(2) {
			position: absolute;
			left: 193px;
			bottom: 88px;
			z-index: 1000;
		}

		.fox {
			color: #fff !important;
			background: linear-gradient(135deg, rgba(132, 229, 255, 1) 0%, rgba(107, 180, 255, 1) 100%, rgba(122, 174, 229, 1) 100%);
		}

		.video_wraper {
			width: 100%;
			height: 18.75rem;
		}
		/*新加样式*/

		.newest_name {
			font-size: 0.7rem;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: rgba(46, 46, 46, 1));
			margin-bottom: 0.1rem;
			/*margin-top: 0.35rem;*/
		}

		.headPortrait {
			width: 2.5rem;
			height: 2.5rem;
			margin-right: 0.3rem;
			/*margin-top: 0.55rem;*/
		}

		.headPortrait img {
			border-radius: 50%;
		}

		.newest_time {
			font-size: 0.5rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
			padding-bottom: 0.2rem;
		}

		.headBox {
			/*margin-left: 0.7rem;*/
			margin-top: 0.85rem;
		}

		.contTit {
			font-size: 0.9rem;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: rgba(77, 77, 77, 1);
			line-height: 1.3rem;
			/*white-space: nowrap;
		      text-overflow: ellipsis;
		      overflow: hidden;*/
			/*padding-left: 0.6rem;*/
			/*width: 17.5rem;*/
			margin-top: 0.4rem;
			margin-bottom: 0.5rem;
			/*margin-left: 0.7rem;*/
			/*margin: 0.5rem 0 0.5rem 2rem;*/
		}

		.contText {
			/*width: 17.5rem;*/
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(89, 89, 89, 1);
			/*margin-top: 0.55rem;*/
			margin-bottom: 0.3rem;
			font-size: 0.7rem;
			padding-top: 0.4rem;
			/*padding-left: 0.6rem;
					padding-right: 0.6rem;*/
			/*padding: 0.6rem 0rem 0.6rem 0.6rem;*/
		}

		.imgBox {
			border-bottom: 1px solid rgba(238, 238, 238, 0.5);
			/*width: 17rem;*/
			height: 6rem;
			display: flex;
			flex-wrap: wrap;
			padding-bottom: 0.8rem;
		}

		.imgItem {
			width: 30%;
			height: 100%;
			background: rgba(216, 216, 216, 1);
			border-radius: 4px;
			/*margin: 0.2rem;*/
			/*margin-left: 0.5rem;*/
		}

		.imgItem:nth-child(2),
		.imgItem:nth-child(3) {
			margin-left: 0.5rem;
		}

		.imgItem img {
			border-radius: 4px;
			width: 100%;
			height: 100%;
		}

		.headPortrait_comment {
			width: 2rem;
			height: 2rem;
			margin-right: 0.3rem;
		}

		.headPortrait_comment img {
			border-radius: 50%;
		}

		.newest_name_comment {
			font-size: 0.7rem;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: rgba(46, 46, 46, 1));
			/*margin-bottom: 0.1rem;*/
			margin-top: 0.1rem;
		}

		.newest_head {
			display: flex;
		}

		.newest_name_time {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: flex-start;
			margin-right: auto;
			/*margin-top: 0.55rem;*/
		}

		.allInfo {
			display: flex;
			flex-wrap: wrap;
		}

		.contentNum {
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(0, 90, 147, 1);
			font-size: 0.7rem;
		}

		.comNum {
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(128, 128, 128, 1);
			font-size: 0.6rem;
			padding-right: 0.3rem;
			margin-top: 0.1rem;
		}

		.comDiv {
			/*border: 1px solid black;*/
			background: rgba(255, 255, 255, 1);
			box-shadow: 0px 7px 5px 0px rgba(0, 0, 0, 0.04);
			margin-bottom: 1rem;
		}

		.moerCom {
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(89, 89, 89, 1);
			text-align: center;
			font-size: 0.75rem;
			padding-bottom: 0.5rem;
		}

		.normalInfo {
			width: 100%;
			height: 15rem;
			/*border: 1px solid black;*/
			/*display:inline;*/
		}

		.infoBox {
			padding: 0 0.7rem 0 0.7rem;
			/*border: 1px solid black;*/
		}
	</style>
</head>


<body>
	<div id="app" v-cloak="">
		<div class="infoBox">
			<!-- 头像\昵称\时间 -->
			<div class="flex-row-center headBox">
				<div class="headPortrait">
					<img :src="info.avatar" />
				</div>
				<div style="display:flex;width:100%;height:100%;">
					<div style="flex:6;display:flex;flex-direction:column;overflow:hidden;">
						<span class="newest_name">
							{{info.nickname}}
							<!-- 张鼎鼎的鱼 -->
						</span>
						<span v-if="info.remark" class="newest_time">
							{{info.create_time}}}
						</span>
						<span v-else class="newest_time" style="flex:1;font-size:.6rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(187,187,187,1);">
							{{info.create_time}}
						</span>
					</div>
					<!-- <div style="flex:4;font-size:.5rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(187,187,187,1);position:relative;">
						<span style="display:inline-block;margin-top:.4rem;text-align:right;position:absolute;right:0;">
								{{info.create_time}}
						</span>
					</div> -->
				</div>
			</div>

			<div class="contTit" id="title">
				{{info.title}}
			</div>

			<div class="contText" v-html="info.content">

			</div>

			<!-- 发布的图片 -->
			<!-- 视频跟图片都存在的情况 -->
			<div class="pic-video"  v-if="info.video_path.length>0 && info.img_path.length>0">
				<!-- 视频//图片 切换按钮 -->
				<div class="pv-btn">
					<div><span @click="tabId=0" :class="{'fox':tabId==0}">视频</span></div>
					<div style="flex:1;"><span @click="tabId=1" :class="{'fox':tabId==1}">图片</span></div>
				</div>
				<!-- 视频//图片切换显示部分 -->
				<div class="tab-con">
					<!-- 视频部分 -->
					<div v-for="(vo,index) in info.video_path" v-show="tabId===0" class="video_wraper" v-if="index == 0">
						<div class="video_play" style="width:100%;height:18.75rem;" :style="{backgroundImage: 'url('+ vo +')',backgroundSize:'cover',width:'100%'}">
							<!-- <img :src="vo" alt="width:auto;height:100%;object-fit: cover;" > -->
							<img @click="videoPlay(info.video[index])" class="play_btn" src="../../image/bg/bg_video.png" alt="" style="width:2.8rem;height:2.8rem;">
						</div>
					</div>
					<!-- 图片部分 -->
					<div v-show="tabId===1" style="width:100%;height:18.75rem;">
						<div class="swiper-container">
							<div class="swiper-wrapper">
								<div v-for="vo in info.img_path" class="swiper-slide" style="width:100%;height:18.75rem;">
									<img :src="vo" style="width:100%;height:100%;object-fit: cover;" />
								</div>
							</div>
						</div>

						<div class="swiper-pagination" style="background-color:rgba(0,0,0,.4);color:#fff;"></div>
					</div>
				</div>
			</div>
			<!-- 只存在视频的情况 -->
			<div v-for="(vo,index) in info.video_path" class="video_wraper" v-else-if="info.video_path.length>0" style="position:relative">
				<div class="video_play" style="width:100%;height:18.75rem;" :style="{backgroundImage: 'url('+ vo +')',backgroundSize:'cover',width:'100%'}">
					<!-- <img :src="vo" alt="width:auto;height:100%;object-fit: cover;" > -->
					<img @click="videoPlay(info.video[index])" class="play_btn" src="../../image/bg/bg_video.png" alt="" style="width:2.8rem;height:2.8rem;">
				</div>
			</div>
			<!-- 只存在图片的情况下  普通资讯-->
			<div class="normalInfo" v-else-if="info.img_path.length>0 && info.catid == '1'">
				<img :src="info.img_path[0]" alt="" style="width:100%;height:100%;">
			</div>

			<!-- 会员秀资讯 -->
			<div class="imgBox" v-else-if="info.img_path.length>0 && info.catid == '2'">
				<div class="imgItem" tapmode v-for="item in info.img_path">
					<img :src="item" style="width:100%;height:100%;object-fit: cover;" />
				</div>
			</div>

		</div>


		<!-- 评论块 -->

		<div class="lh10" v-if="info.status == '1'"></div>
		<div v-if="info.status == '1'" style="background-color:#fff;">
			<!-- 具体评论内容 -->
			<div style="padding:0.75rem;padding-bottom:0" tapmode>
				<div class="comDiv" v-for="(vo,index) in info_list"  :class="{'expext_last_margin_bottom':index != info_list.length - 1}">
					<div class="allInfo">
						<!-- 头像 名称 时间 -->
						<div class="newest_head">
							<div class="headPortrait_comment">
								<img :src="vo.avatar" alt="">
							</div>

							<div class="newest_name_time">
								<!-- 名称 -->
								<div class="newest_name_comment">
									{{vo.nickname}}
								</div>
								<!-- 时间 -->
								<div class="left_addtime">
									{{vo.add_time}}
									<!-- 2020.08.16 00:00 -->
								</div>
							</div>

						</div>

						<!-- 内容 -->
						<div class="content_main" v-html="transEmo(vo.content).replace(/\n/g, '<br/>')">
						</div>
						<!-- {{info_list}} -->
					</div>

					<div class="footer_wraper" :class="{'expext_last_bottom':index != info_list.length - 1}">
						<!-- 回复条数 -->
						<div class="contentNum">
							<div v-if="vo.next.length > 0" @click="openWin_circle_comment(1,info.id,info.catid,vo.id)">
								共{{vo.next.length}}条回复 >
							</div>

						</div>
						<!-- 右边操作 -->
						<div class="right_zan">
							<div class="comNum">{{vo.next.length}}</div>
							<div style="width:0.9rem;height:0.85rem;flex-shrink: 0;margin-top:0.1rem;" tapmode @click="popupKeyboard(vo.id,vo.nickname,vo.uid,vo.catid,vo.article_id)">
								<img v-if="vo.next.length=='0'" src="../../image/icon/contecicon.png" style="width:0.9rem;height:0.85rem;flex-shrink: 0;">
								<img v-if="vo.next.length>'0'" src="../../image/icon/news_detail.png" style="width:0.9rem;height:0.85rem;flex-shrink: 0;">
							</div>
							<div style="display:flex;align-items:center;margin-left:1rem;" tapmode @click="opera_data(1,vo.id,vo.catid,index)">
								<span class="zan_style">{{vo.zan_num}}</span>
								<div style="width:0.9rem;height:0.85rem;flex-shrink: 0;">

									<img v-if="vo.is_zan=='0'" src="../../image/icon/icon-zan.png" style="width:0.9rem;height:0.85rem;flex-shrink: 0;">
									<img v-else="vo.is_zan=='1'" src="../../image/icon/icon-zan-active.png" style="width:0.9rem;height:0.85rem;flex-shrink: 0;">
								</div>

							</div>

						</div>
					</div>


				</div>



				<!-- <div class="moerCom" v-if="info.comment.length > 2" tapmode @click="openWin_circle_allcomment(2,info.comment.article_id)">
					查看更多评论
				</div> -->
				<div class="moerCom" v-if="moreShowBoolen" tapmode @click="moreShow">
					查看更多评论
				</div>

			</div>

			<!-- <div class="no_comment" v-if="info.comment.length < 1">
				<img src="../../image/bg/no-comment.png" style="width:7.55rem" />
				<div>
					暂无评论
				</div>
			</div> -->

			<!-- <div v-if="info.comment<1" class="aui-text-center" style="margin-top:2.5rem;">
				<img src="../../image/bg/no-comment.png" style="width:7.55rem;margin-left:50%;transform:translateX(-50%);margin-bottom:1.35rem" />
				<div style="font-size:.75rem;font-family:PingFangSC-Regular;font-weight:400;color:#B3B3B3;margin-bottom:2.5rem;">
					暂无评论
				</div>
			</div> -->


			<div v-if="info_list.length<1" class="aui-text-center" style="margin-top:2.5rem;" tapmode>
				<img src="../../image/bg/no-comment.png" style="width:7.55rem;margin-left:50%;transform:translateX(-50%);margin-bottom:1.35rem" />
				<div style="font-size:.75rem;font-family:PingFangSC-Regular;font-weight:400;color:#B3B3B3;margin-bottom:2.5rem;">
					暂无评论
				</div>
			</div>


		</div>

		<!-- 获取金币 -->
		<div v-show="share_show" class="aui-mask aui-mask-in" style="z-index:9999;">
			<div class="aui-text-center" style="width: 11rem;height: 155px;margin-left: calc(50vw - 110px);margin-top: calc(40vh - 78px);position: relative;">
				<img style="width: 11rem;height: 7.75rem;" src="../../image/bg/bg-share-gold.png" />
				<div style="background:#fff;position: absolute;width: 100%;">
					<span style="font-size: 1.5rem;padding-bottom: .85rem;">+{{share_gold}}</span>
					<p class="aui-font-size-13" style="padding-bottom: .85rem;">恭喜您获得金币奖励</p>
				</div>
				<div align="center" @click="share_show_hide()">
					<img style="max-height: 100%;max-width: 800%;margin-top:60px;" src="../../image/bg/bg-share-gold-bottom.png" />
				</div>
			</div>
		</div>
	</div>


</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/emoji.js"></script>
<script type="text/javascript" src="../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../script/aui-sharebox.js"></script>
<script>
	var vm = new Vue({
		el: "#app",
		data: {
			id: 0,
			info: {
				catid: 1
			},
			share_pic: '',
			pic_done: false,
			share_show: false,
			clickEmotion: false,
			share_gold: 0,
			uid: 0,
			can_delete: false,
			tabId: 1,

			to_uid: 0,
			pid: 0,
			content: '',
			tonickname: '',
			info_list: [],
			page: 1,
			minLimit: 0,
			maxLimit: 3,
			catid: 1,
			loadmore: true,
			moreShowBoolen: false
		},



		methods: {
			// 下载图片
			downloadImg: function(img) {
				getHasPermission('storage', function(ret) {
					var imgName = new Date().getTime() + ".jpg";
					api.download({
							url: img,
							savePath: "fs://thumb_wz_" + imgName,
							report: true,
							cache: true,
							allowResume: true
						},
						function(ret) {
							vm.share_pic = ret.savePath;
						}
					);
				})
			},
			//点赞某评论
			opera_data: function(index, id, catid, index1) {
				var type = index;
				var index1 = index1;
				var id = id;
				var catid = catid;
				var source = catid == 1 ? 'xx_reply' : 'xyx_reply';
				opera(id, source, type, function(ret) {
					//console.log(JSON.stringify(ret));
					// if (ret.status && ret.data) {
					//点赞
					if (ret.status == 1 && ret.data == 1) {
						toast('取消点赞成功')
						vm.info_list[index1].is_zan = '0'
						vm.info_list[index1].zan_num = parseInt(vm.info_list[index1].zan_num) - 1;
					} else if (ret.status == 1 && ret.data == 0) {
						toast('点赞成功')
						vm.info_list[index1].is_zan = '1'
						vm.info_list[index1].zan_num = parseInt(vm.info_list[index1].zan_num) + 1;
					}

					// }
				})
			},
			videoPlay: function(path) {
				openWin('circle/video_new', {
					video: path
				})
			},

			get_list: function() {
				get_data('api/xiaoyouquan/xyqDetail', {
					token: $api.getStorage('token'),
					id: vm.id
				}, function(ret) {
					//alert(JSON.stringify(ret,null,2))
					//  alert(JSON.stringify(ret.data.img_path,null,2))
					if (ret.status) {
						vm.info = ret.data
						vm.catid = ret.data.catid
							// console.log(vm.info);
						setTimeout(function() {
								var swiper = new Swiper('.swiper-container', {
									pagination: '.swiper-pagination',
									paginationType: 'fraction',
									autoplay: false, //可选选项，自动滑动
									loop: true, //可选选项，是否循环
									autoplayDisableOnInteraction: false, //注意此参数，默认为true
								});
								if (vm.info.catid == 2 && vm.info.img_path.length == 0) {
									$api.fixStatusBar($api.byId('aui-header1'))
								} else {
									$api.fixStatusBar($api.byId('aui-header'))
								}

								//判断是否自己发布的
								if (vm.info.catid == '2' && vm.info.uid == vm.uid) {
									vm.can_delete = true;
								}
							}, 100)
							//下载封面图片,分享图片用.
						if (vm.info.catid == 2) {
							if (vm.info.img_path.length < 1) {
								vm.share_pic = '../../image/logo.jpg'
								vm.pic_done = true
							} else {
								vm.downloadImg(vm.info.share_pic[0]);
								// alert(vm.info.share_pic[0])
								// return
								// console.log(vm.info.share_pic[0])
								// download(vm.info.share_pic[0], function (ret) {
								// 	console.log(JSON.stringify(ret))
								// 	compress_pic(ret, function () {
								// 		alert(66)
								// 		vm.downloadImg(ret);
								// 		alert(JSON.stringify(ret))
								// 		vm.pic_done = true
								// 	})
								// })
							}
						}
						if (vm.info.catid == 1) {
							if (!vm.info.cover) {
								vm.share_pic = '../../image/logo.jpg'
								vm.pic_done = true
							} else {
								vm.downloadImg(vm.info.cover);
								// console.log(vm.info.cover)
								// download(vm.info.cover, function (ret) {
								// 	compress_pic(ret, function () {
								// 		vm.share_pic = ret;
								// 		vm.pic_done = true
								// 	})
								// })
							}
						}
					}
				})
			},

			get_list_commentList() {
				get_data('api/Xiaoyouquan/commentList', {
					token: $api.getStorage('token'),
					article_id: vm.id,
					catid: vm.catid,
					page: vm.page,
					minLimit: vm.minLimit,
					maxLimit: vm.maxLimit
				}, function(ret) {
					// 	alert(JSON.stringify({
					// 	token: $api.getStorage('token'),
					// 	article_id: vm.id,
					// 	catid: vm.catid,
					// 	page: vm.page,
					// 	minLimit: vm.minLimit,
					// 	maxLimit: vm.maxLimit
					// }))
					//  alert(JSON.stringify(ret,null,2));
					// 	alert(ret.data.list.length)
					// 	console.log(JSON.stringify({
					// 	token: $api.getStorage('token'),
					// 	article_id: vm.id,
					// 	catid: vm.catid,
					// 	page: vm.page
					// }))
					// alert(JSON.stringify(ret,null,2));
					if (ret.status) {
						vm.info_list = ret.data.list;
						//alert(JSON.stringify(vm.info_list))
						var total_num = vm.minLimit + vm.maxLimit;
						if (total_num >= ret.data.comment_count) {
							vm.moreShowBoolen = false
						} else {
							vm.moreShowBoolen = true
						}
						// if (ret.data.list <= 10) {
						// 	vm.info_list = ret.data.list;
						// 	vm.moreShowBoolen = false
						// } else {
						// 	vm.info_list = ret.data.list.slice(0, 10);
						// 	vm.moreShowBoolen = true
						// }
					}

				})
			},
			moreShow() {
				vm.minLimit = vm.minLimit + vm.maxLimit;
				vm.maxLimit = 10;
				get_data('api/Xiaoyouquan/commentList', {
					token: $api.getStorage('token'),
					article_id: vm.id,
					catid: vm.catid,
					page: vm.page,
					minLimit: vm.minLimit,
					maxLimit: vm.maxLimit
				}, function(ret) {

					if (ret.status) {
						vm.info_list = vm.info_list.concat(ret.data.list)
						var total_num = vm.minLimit + vm.maxLimit;
						if (total_num >= ret.data.comment_count) {
							vm.moreShowBoolen = false
						} else {
							vm.moreShowBoolen = true
						}
					}
					// alert(JSON.stringify(ret,null,2));
					// vm.info_list = vm.info_list.concat(ret.data.list.slice(vm.page*10,(vm.page+1)*10 ))
					// vm.page++
					// if (ret.data.list.length >= (vm.page * 10)) {
					// 	vm.moreShowBoolen = true
					// } else {
					// 	vm.moreShowBoolen = false
					// }
				})
			},
			transEmo: function(emoMsg) {
				var emoPath, transMsg;
				var reg = /\[(.*?)\]/gm;
				transMsg = emoMsg.replace(reg, function(match) {
					for (var i = 0, len = emoData.length; i < len; i++) {
						if (emoData[i].text === match) {
							emoPath = '../../res/emotion/' + emoData[i].name + '.png';
							return '<img width="20" height="20" src="' + emoPath + '" />'
						}
					}
					return match;
				});
				return transMsg;
			},

			popupKeyboard: function(pid, tonickname, to_uid, catid, article_id) {
				UIChatBox.popupKeyboard();
				openchatbox();
				vm.content = ''
				vm.pid = pid;
				vm.to_uid = to_uid;
				vm.catid = catid;
				vm.id = article_id;
				console.log(vm.pid);
				console.log(tonickname);
				console.log(vm.to_uid);
				console.log(vm.catid);
				console.log(vm.id);
				var tonickname = tonickname;

				UIChatBox.setPlaceholder({
					placeholder: '回复' + tonickname
				});
			},
		}
	})


	var UIChatBox;
	apiready = function() {


		$api.fixTabBar($api.byId('footer'))
		add_event('refresh_data', function() {
				vm.get_list()
				vm.get_list_commentList()

			})
			// 引用模块 调用键盘
		UIChatBox = api.require('UIChatBox');


		vm.id = $api.getStorage('id')
		if ($api.getStorage('userinfo')) {
			vm.uid = $api.getStorage('userinfo').id
		}
		vm.get_list()
		vm.get_list_commentList()
		fnInitPullRefresh(function() {

				vm.page = 1;
				vm.loadmore = true
				vm.info = [];
				vm.info_list = [];
				vm.get_list()
				vm.get_list_commentList()
					// api.refreshHeaderLoadDone();

			})
			// 新版刷新
		refresh_new(function() {
			setTimeout(function() {
				vm.get_list()
				vm.get_list_commentList()

				api.refreshHeaderLoadDone()
			}, 1000)
		})
		// fnInitScrollToBottom(function(ret) {
		// 	console.log(111)
		// 	if (vm.loadmore) {
		// 		vm.page++;
		// 		vm.get_list()
		// 		vm.get_list_commentList()
		//
		// 	}
		// })

		add_event('share_zixun', function() {
			openSharebox();
		})
		add_event('is_collection', function() {
			// opera_data(1);
		})
		add_event('open_chatbox', function() {
			openchatbox();
		})
		add_event('is_thumbs', function() {
				// opera_data(2);
				// vm.get_list();
				send_event('ll', function() {

				})
			})
			// 子页面点赞刷新
		add_event('refresh_thumbs', function() {
			vm.get_list()
			vm.get_list_commentList()

		})

		add_event('getUsage', function() {
			// vm.get_list()
			// alert(3366)
		})

	};

	// function opera_data(type) {
	// 	var source = vm.info.catid == '1' ? 'xx' : 'xyx'
	// 	opera(vm.id, source, type, function (ret) {
	// 		if (ret.status) {
	// 			toast(ret.msg)
	// 			vm.get_list()
	// 			vm.get_list_commentList()

	// 			//通知帖子刷新
	// 			send_event('circle_opera')
	// 			send_event('fav_ref')
	// 		}
	// 	})
	// }
	// 发送评论
	function sendComment() {
		var UIChatBox = api.require('UIChatBox');
		UIChatBox.closeKeyboard();
		get_data('api/Xiaoyouquan/sendComment', {
			token: $api.getStorage('token'),
			article_id: vm.id,
			catid: vm.catid,
			pid: vm.pid,
			to_uid: vm.to_uid,
			content: vm.content
		}, function(ret) {
			// alert(JSON.stringify(ret))
			toast(ret.msg)
			if (ret.status) {
				vm.content = ''
					// vm.get_list()
					// vm.get_list_commentList()
				vm.info_list.unshift(ret.data);
				// alert(JSON.stringify(ret))
				send_event('comments');
			}
		})
	}

	// 修改输入框样式
	function openchatbox() {
		if (!$api.getStorage('token')) {
			openWin_login()
			return;
		}
		UIChatBox.open({
			autoFocus: true,
			placeholder: '请输入您的评论',
			maxRows: 4,
			emotionPath: 'widget://res/emotion',
			texts: {
				sendBtn: {
					title: "发布"
				}
			},
			styles: {
				// 输入键盘全局颜色
				inputBar: {
					borderColor: '#f5f5f5',
					bgColor: '#ffffff',
				},
				// 输入框颜色
				inputBox: {
					borderColor: '#f6f6f6',
					bgColor: '#f6f6f6',
					boardBgColor: '#FFFFFF',
				},
				emotionBtn: {
					normalImg: 'widget://image/btn/btn-smile.png'
				},
				keyboardBtn: {
					normalImg: 'widget://res/img/chatBox_key1.png'
				},
				indicator: {
					target: 'both',
					color: '#c4c4c4',
					activeColor: '#9e9e9e'
				},
				sendBtn: {
					titleColor: '#ffffff',
					bg: '#6BB4FF',
					activeBg: '#ff00ff',
					titleSize: 15,
				}
			}
		}, function(ret, err) {
			// alert(JSON.stringify(ret,null,2))

			if (ret) {
				// alert("评论内容"+vm.content)
				if (vm.content != '') { //CONTNT评论内容
					// alert(2)
					UIChatBox.value({
						msg: vm.content
					});
				}
				// alert("评论内容"+vm.content)
				if (ret.eventType == 'send' && ret.msg != '') {
					// alert(1)
					vm.content = ucs2_to_utf16(ret.msg) //ucs-2转utf-16（将表情图转换为实体字符）
					sendComment()
				}
				UIChatBox.addEventListener({ //实时监听输入的内容
					target: 'inputBar',
					name: 'valueChanged'
				}, function(ret, err) {
					// alert(JSON.stringify(ret,null,2))
					if (ret) {
						if (ret.value.length > 50) {
							alert('单次评论最多50字哦！');
							UIChatBox.value({
								msg: ret.value.slice(0, 50)
							});
							vm.content = ret.value.slice(0, 50)
						} else {

							vm.content = ret.value
						}
					} else {
						console.log(JSON.stringify(err));
					}
				});
				UIChatBox.addEventListener({ //实时监听输入框模块的状态，输入框和图片展示框
					target: 'inputBar',
					name: 'move'
				}, function(ret, err) {
					//  alert(JSON.stringify(ret,null,2))
					if (ret) {
						console.log(JSON.stringify(ret));

						setTimeout(function() {
							if (ret.panelHeight == '0' && !vm.clickEmotion) { //panelHeight，图片部分高度，vm.clickEmotion是否有点击图片
								UIChatBox.close();
							}
						}, 50)
					} else {
						console.log(JSON.stringify(err));
					}
				});
				UIChatBox.addEventListener({
					target: 'inputBar',
					name: 'showEmotion'
				}, function(ret, err) {
					// alert("last："+JSON.stringify(ret,null,2))
					if (ret) {
						console.log('点击表情了');
						vm.clickEmotion = true;
						setTimeout(function() {
							vm.clickEmotion = false
						}, 500)
					} else {
						console.log(JSON.stringify(err));
					}
				});
				//console.log(JSON.stringify(ret));
			} else {
				console.log(JSON.stringify(err));
			}

		});
	}


	function countSymbols(string) {
		return twemoji.parse(string).replace(/<img.+?\/>/g, '_').length;
	}

	var sharebox;

	function openSharebox() {
		if (!$api.getStorage('token')) {
			openWin_login()
			return;
		}
		if (sharebox && sharebox.maskDiv) {
			sharebox.close();
			return;
		}
		// sharebox = new auiSharebox();
		// sharebox.init({
		// 	frameBounces: true, //当前页面是否弹动，（主要针对安卓端）
		// 	buttons: [{
		// 		image: '../../image/btn/Space.png',
		// 		text: '朋友圈',
		// 		value: 'wx-circle'
		// 	}, {
		// 		image: '../../image/btn/friends.png',
		// 		text: '微信好友',
		// 		value: 'wx' //可选
		// 	}, {
		// 		image: '../../image/btn/weibo.png',
		// 		text: '新浪微博',
		// 		value: 'weiboPlus'
		// 	}, {
		// 		image: '../../image/btn/report.png',
		// 		text: '举报',
		// 		value: 'report'
		// 	}],
		// 	col: 3,
		// 	shareTitle: '分享到', //可选,当然也可以采用下面的方式使用图标
		// 	cancelTitle: '取消'
		// }, function(ret) {
		// 	if (ret) {
		// 		console.log(ret.buttonIndex + '/' + ret.buttonValue)
		// 		if (ret.buttonIndex == 1) {
		// 			shareTowx('timeline')
		// 		}
		// 		if (ret.buttonIndex == 2) {
		// 			shareTowx('session')
		// 		}
		// 		if (ret.buttonIndex == 3) {
		// 			shareTowb()
		// 		}
		// 		if (ret.buttonIndex == 4) {
		// 			shareTorp()
		// 		}
		// 	}
		// })

		if (vm.can_delete == true) { //是否可以删除的判断
			var text = '删除';
			var icon = 'widget://image/btn/delete.png';
		} else {
			var text = '举报';
			var icon = 'widget://image/btn/report.png';
		}

		var dialogBox = api.require('dialogBox');
		dialogBox.actionMenu({
			animation: true,
			isCuttingLine: true,
			tapClose: true,
			rect: {
				h: 197
			},
			texts: {
				cancel: '取消'
			},
			items: [{
				text: '朋友圈',
				icon: 'widget://image/icon/wechatSpace.png'
			}, {
				text: '微信好友',
				icon: 'widget://image/icon/friends.png'
			}, {
				text: text,
				icon: icon
			}],
			styles: {
				bg: '#FFF',
				column: 3,
				itemText: {
					color: '#333',
					size: 15,
					marginT: 0
				},
				itemIcon: {
					size: 60
				},
				cancel: {
					bg: 'fs://icon.png',
					color: '#666666',
					h: 55,
					size: 15
				}
			}
		}, function(ret) {
			if (ret) {
				if (ret.eventType == "cancel") {
					dialogBox.close({
						dialogName: 'actionMenu'
					});
				}
				if (ret.index == "0") {
					shareTowx('timeline')
					dialogBox.close({
						dialogName: 'actionMenu'
					});
				}
				if (ret.index == "1") {
					// alert(444)
					shareTowx('session')
					dialogBox.close({
						dialogName: 'actionMenu'
					});
				}
				if (ret.index == "2") {
					shareTowb()
					dialogBox.close({
						dialogName: 'actionMenu'
					});
				}
				if (ret.index == "3") {
					if (vm.can_delete == true) { //删除
						get_data('api/xiaoyouquan/xyqDelPublish', {
							token: $api.getStorage('token'),
							id: vm.id
						}, function(ret) {
							if (ret.status) {
								toast(ret.msg)
								send_event('xyqedit', {
									id: vm.id,
								})
								delay_close()
							}
						})
					} else {
						shareTorp()
					}

					dialogBox.close({
						dialogName: 'actionMenu'
					});
				}
			}

		});
	}

	function shareTorp() {
		openWin('circle/report', {
			type: vm.info.catid
		});
	}

	function shareTowx(type) {
		// alert(type)
		var contentUrl = 'http://zm.zonmay.com/wap/share/circle/id/' + vm.id + '.html'
			//			var title = vm.info.title
		var title = $api.text($api.byId('title')).replace(/\s/g, "");
		var wx = api.require('wxPlus');
		wx.isInstalled(function(ret, err) {
			if (ret.installed) {} else {
				toast('当前设备未安装微信客户端');
				return;
			}
		});
		// alert(JSON.stringify({
		// 	scene: type,
		// 	title: title,
		// 	description: title,
		// 	contentUrl: contentUrl,
		// 	thumb: vm.share_pic
		// }))
		// return
		wx.shareWebpage({
			scene: type,
			title: title,
			description: title,
			contentUrl: contentUrl,
			thumb: vm.share_pic
		}, function(ret, err) {
			// alert(JSON.stringify(ret)+JSON.stringify(err))
			if (ret.status) {
				toast('分享成功');
				get_data('api/user/shareTakeGold', {
					token: $api.getStorage('token'),
					article_id: vm.id
				}, function(ret) {
					if (ret.status) {
						vm.share_gold = ret.data.gold
						vm.share_show = true
						vm.info.repeat_num += 1;
						setTimeout(function() {
							vm.share_show = false
						}, 300000)
					}
				})
			} else {
				if (err.code == '2') {
					toast('取消分享');
				}
				console.log(err.code);
			}
		});
	}

	function shareTowb() {
		var contentUrl = 'http://zm.zonmay.com/wap/share/circle/id/' + vm.id + '.html'
			//			var title = vm.info.title
		var title = $api.text($api.byId('title'))
		var weibo = api.require('weiboPlus');
		weibo.shareWebPage({
			text: title + '。详情点击链接查看',
			title: title,
			description: title,
			//				thumb: vm.info.cover,
			thumb: vm.share_pic,
			contentUrl: contentUrl
		}, function(ret, err) {
			console.log(JSON.stringify(ret))
			if (ret.status) {
				toast('分享成功');
				get_data('api/user/shareTakeGold', {
					token: $api.getStorage('token'),
					article_id: vm.id
				}, function(ret) {
					if (ret.status) {
						vm.share_gold = ret.data.gold
						vm.share_show = true
						vm.info.repeat_num += 1;
						setTimeout(function() {
							vm.share_show = false
						}, 300000)
					}
				})
			} else {
				if (err.code == '1') {
					toast('取消分享');
				}
				console.log(JSON.stringify(err))
			}
		});
	}

	function share_show_hide() {
		vm.share_show = false;
	}
</script>

</html>
